<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
	<title>通知</title>
	<link rel="stylesheet" type="text/css" href="../../css/aui-win.css" />
	<link rel="stylesheet" type="text/css" href="../../css/pullToRefresh.css">
	
<style>
a {
	text-decoration: none;
}
/*设置内容区样式*/
body {
	min-width: 320px;
}
#wrapper {
	background-color: #f2f2f2;
}
#wrapper ul li {
	overflow: hidden;
	border-bottom: 1px solid #d9d9d9;
}
#wrapper ul li a {
	display: block;
	overflow: hidden;
	position: relative;
	padding: 10px 10px 5px 10px;
}
#wrapper ul li a.active {
	background-color: #d9e4e9;
}
#img {
	float: left;
	width: 40px;
	height: 40px;
	border-radius: 4px;
}
#wrapper .content {
	margin-left:50px;
	overflow: hidden;
}
#wrapper .content h2, #news h2 {
	font-size: 16px;
	line-height:20px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 800;
	margin-bottom: 6px;
	color:#333;
}
#wrapper .content p {
	width: 100%;
	color: #999;
	height: 48px;
	font-size: 12px;
	line-height:16px;
	text-overflow: -o-ellipsis-lastline;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	text-indent:2em;
}
#wrapper .t .content div:after {
	content: "专题";
	background-color: #55abce;
	border: 1px solid #55abce;
	border-radius: 4px;
	color: #fff;
	font-size: 12px;
	padding: 2px 6px;
	float: right;
	height: 14px;
	line-height: 14px;
}
#wrapper .v a:before {
	content: "";
	display: inline-block;
	background: #0c0a0f url(../image/video.png) no-repeat center;
	-webkit-background-size: 16px 12px;
	background-size: 16px 12px;
	width: 24px;
	height: 24px;
	border: 2px solid #666;
	border-radius: 24px;
	opacity: .8;
	position: absolute;
	left: 14px;
	top: 58px;
}
.comment {
	margin-left: 10%;
}
.counts {
	position: absolute;
	right: 2%;
}
.time {
	float:right;
	height: 18px;
	line-height:18px;
	overflow: hidden;
	color:#999;
	margin-top:4px;
	margin-right:10px;
}
.icon {
	margin-right: 2px;
	position:relative;
	width:12px;
	height:12px;
}
.content-bottom span{
	color:#999;
	font-size:13px;
}

		#pullUp{
			display: none;
		}
		.content-bottom{
			height:20px;
			line-height:25px;
		}
</style>
<script src="../../script/iscroll.js"></script>
<script src="../../script/pullToRefresh.js"></script>
<script src="../../script/jquery-1.10.2.min.js"></script>
<script src="../../script/common.js"></script>

</head>
<body>
        <div class="div_loding_img">
		数据加载中
		</div>
	<header class="aui-bar aui-bar-nav aui-bar-yunzo" id="aui-header">
		<a class="aui-btn aui-bar-yunzo aui-pull-left" id="back"> <span class="aui-iconfont aui-icon-left"></span></a>
		<div class="aui-title" id="title">
			通知
		</div>
	</header>
	<div class="margin_div"></div>
	<div id="wrapper">
		<ul  id="txtNewsList"></ul>
	</div>
<script type="text/javascript">
refresher.init({
	id:"wrapper",
	pullDownAction:Refresh,
	pullUpAction:Load
	});
//显示数据条数
var pagesize=10;
//当前数量
var curCount = 0;
var baseparam;
var arr_data=new Array();
$(document).ready(function(){
	goback("../main.html");
	baseparam=basedata('informinfo');
    
    getListData();
});

function getListData()
{	
	$(".div_loding_img").css("display","block")

	var post=baseparam+"&pagesize="+pagesize+"&curCount="+curCount;
	arr_data=[];
	
	ajaxcocRequest('../../../api/group/getgroupinforminfolist', 'post', post, function(msg){
		if(msg.code ==100){
			if(msg.data.length==0){
				$('#txtNewsList').html("<div style='width:20%;margin:40px 0 0 40%;'><img src='../../image/gantan.png' style='width:100%;'></div><p style='width:100%;text-align:center;margin-top:30px;color:#999;font-size:18px;'>没有任何通知信息</p>");
				$(".div_loding_img").css("display","none");
				$(".pullUpLabel").css("color","#f5f5f5");
			}
			else{
				curCount+=curCount+msg.data.length;
			$('#txtNewsList').html("");
			for(var i = 0;i < msg.data.length;i++){
				var obj=$("#txtNewsList");
				var thisItem=msg.data[i];
				var content = thisItem.n3;
				var dd = content.replace(/<\/?.+?>/g, "");
				var dds = dd.replace(/&nbsp;/g, "");
				//alert(thisItem.n4)
				var imgSrc = thisItem.n1;
				if (imgSrc=="null") {
					imgSrc = "../../image/home/busess/yunzo_def_info.png";
				}
				var li  = document.createElement("li");
				li.innerHTML = '<a href="inform_info.html?infoid='+thisItem.n0+'&comments='+thisItem.n5+'&brows='+thisItem.n6+'"><div class="logo"><img id="img" src="' + imgSrc + '"/></div><div class="content"><h2>' + thisItem.n2 + '</h2><div class="content-bottom"><span class="time">' + thisItem.n4 + '</span><img class="icon" src="../../image/home/busess/chakan.png"><span style="margin-left:2px;">' + thisItem.n6 + '</span><img class="icon" style="margin-left:5px;" src="../../image/home/busess/pinglun.png"><span style="margin-left:2px;">' + thisItem.n5 + '</span></div></div> </a>';
				obj.append(li);
				
			
				arr_data.push(msg.data[i].n0);								
			}
			$(".div_loding_img").css("display","none")
			$("img").error(function(){
				$(this).attr("src","../../image/home/busess/yunzo_def_info.png")
			})
			$(".div_loding_img").css("display","none")
		}
		}else{
			$(".div_loding_img").css("display","none")
			$("body").append('<div class="wuwang"><img src="../../image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
			
		}
	});

}
function Refresh(){
	window.history.go(0)
	wrapper.refresh();
}

function Load(){
	if(curCount==pagesize)
		{
	$(".div_loding_img").css("display","block")
	var obj=$("#txtNewsList");
	pagesize=pagesize+5;
	var post =baseparam+"&pagesize="+pagesize+"&curCount="+curCount;
   	ajaxcocRequest('../../../api/group/getgroupinforminfolist', "post", post, function(msg){
		if(msg.code ==100){
				var strr="";
				var imgSrc="";
				for(var i=0;i<msg.data.length;i++){
					var tag=false;
					for(var j=0;j<arr_data.length;j++){

						if(msg.data[i].n0===arr_data[j]){
							tag=true;
							break;
						}
					}
					if(!tag){
						var content = msg.data[i].n3;
						var dd = content.replace(/<\/?.+?>/g, "");
						var dds = dd.replace(/&nbsp;/g, "");
						if (msg.data[i].n1 != "null") {
							imgSrc = msg.data[i].n1;
						} 
						else {
							imgSrc = '../../image/home/busess/yunzo_def_info.png';
						}
						strr='<li><a href="inform_info.html?infoid='+msg.data[i].n0+'&comments='+msg.data[i].n5+'&brows='+msg.data[i].n6+'"><div class="logo"><img id="img" src="' + imgSrc + '"/></div><div class="content"><h2>' + msg.data[i].n2 + '</h2><span class="time">' + msg.data[i].n4 + '</span><img class="icon" src="../../image/home/busess/chakan.png"><span style="margin-left:2px;color:#999;">' + msg.data[i].n6 + '</span><img class="icon" style="margin-left:5px;" src="../../image/home/busess/pinglun.png"><span style="margin-left:2px;color:#999;">' + msg.data[i].n5 + '</span></div> </a></li>'
						arr_data.push(msg.data[i].n0);
						obj.append(strr);
						wrapper.refresh();	
					}
					$("img").error(function(){
						$(this).attr("src","../../image/home/busess/yunzo_def_info.png")
					})
				}
				$(".div_loding_img").css("display","none")
				wrapper.refresh();	
				
		}
		else{
			$("body").append('<div class="wuwang"><img src="../../image/iconfont-wangluo.png"><p>网络拥堵，信息塞车</p></div>')
			$(".div_loding_img").css("display","none")
		}
	});
}else
	{
	$(".div_loding_img").css("display","none")
	}
}
</script>
</body>
</html>